Step 1: Creating the User Interface (Microsoft Visual C++)
To return to the introduction, go to Creating a Microsoft Visual C++ sample application with the Embeddable Designer.
In this step, you will create a Dialog-based MFC.EXE application and add the components, and controls for the application.
- Using the AppWizard, create a starter Dialog-based MFC application. The main dialog will display reports in Embeddable Designer and the Crystal Report Viewer.
- Project Name: Embeddable_Designer
- Application Class Name: CEmbeddable_DesignerApp
- Dialog Class Name: CEmbeddable_DesignerDlg
- Add the Embeddable Designer Control and the Crystal Report Viewer Control through the Components and Controls Gallery dialog box. The controls are in the Registered ActiveX Controls folder:
- Embeddable Crystal Reports 8.5 Designer Control
- Crystal Report Viewer Control
- Add the following controls from the Toolbox to IDD_EMBEDDABLE_DESIGNER_DIALOG (Embeddable Designer dialog):
- six buttons
- Embeddable Crystal Reports 8.5 Designer
- Crystal Report Viewer
- Set the properties for the Embeddable Designer dialog and its controls:
- IDD_EMBEDDABLE_DESIGNER_DIALOG (Create, open, save, design and preview reports):
- Caption: Embeddable Designer
- Height: 340
- Width: 540
- Embeddable Crystal Reports 8.5 Designer Control (Designs and edits reports):
- Height: 300
- Left: 7
- Top: 7
- Width: 525
- Crystal Report Viewer:
- Height: 300
- Left: 7
- Top: 7
- Width: 525
Note: Either the Embeddable Designer or the Crystal Report Viewer will be hidden depending on wether the user is designing or previewing a report.
- All Buttons (Common Properties):
- Align all Buttons to the bottom of the form
- Height: 14
- Width: 50
- Button1 (Creates a new report):
- ID: IDC_NEW_REPORT
- Caption: &New Report
- Left: 7
- Button2 (Opens an existing report):
- ID: IDC_OPEN_REPORT
- Caption: &Open Report
- Left: 66
- Button3 (Saves a report):
- ID: IDC_SAVE_REPORT
- Caption: &Save Report
- Left: 125
- Button4 (Shows the Crystal Report Viewer and hides the Embeddable Designer.):
- ID: IDC_PREVIEW
- Caption: &Preview
- Left: 184
- Button5 (Shows the Embeddable Designer and hides the Crystal Report Viewer):
- ID: IDC_SHOW_DESIGNER
- Caption: &Design
- Left: 184
- Button6 (Exits the application):
- ID: IDCANCEL
- Caption: E&xit
- Left: 483
To continue with this procedure, go to Step 2: Adding member variables and member functions (Microsoft Visual C++).